<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>仿土豆网显示隐藏遮罩案例</title>
    <style>
      .tudou {
        position: relative;
        width: 444px;
        height: 320px;
        margin: 20px auto;
      }
      .tudou img {
        width: 100%;
        height: 100%;
      }
      .mask {
        /* 隐藏遮罩层 */
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4) url(image/arr.png) no-repeat center;
      }
      /* 当我们鼠标经过土豆这个盒子，就让里面的遮罩层示出来 */
      .tudou:hover .mask {
        /* 显示遮罩层 */
        display: block;
      }
    </style>
  </head>
  <body>
    <div class="tudou">
      <div class="mask"></div>
      <img src="image/image1.00.webp" />
    </div>
  </body>
</html>
